<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</meta>
<title>F.pagination</title>
<link type="text/css" rel="stylesheet" href="../css/admin.css" />
<link type="text/css" rel="stylesheet" href="../css/item_show.css" />
<script type="text/javascript" src="../../1st.js"></script>
<script type="text/javascript" src="../../1st.highlight.js"></script>
</head>
<body id="split">
<div id="content">
	<div rel="F.param">
		<h2><span>返回值:</span>F.pagination</h2>
					<h3>概述 : 分页类</h3>
									<h3>语法1：F.pagination(box,callback)</h3>
							<div>描述：链头</div>
						<table class="args">
				<!--caption>参数列表：(2)</caption-->
				<tr><th>参数名称</th><th>类型</th><th>描述</th></tr>
									<tr><td><strong>box</strong></td><td>ID,Node</td><td>容器</td></tr>
									<tr><td><strong>callback</strong></td><td>Function</td><td>回调函数</td></tr>
								<tr><td colspan="3">&nbsp;</td></tr>
				<tr><td>返回值</td><td>fdom</td><td>返回pager链</td></tr>
			</table>
					<h3>语法2：.setsize(num)</h3>
							<div>描述：链身，设置每屏页数</div>
						<table class="args">
				<!--caption>参数列表：(1)</caption-->
				<tr><th>参数名称</th><th>类型</th><th>描述</th></tr>
									<tr><td><strong>num</strong></td><td>Number</td><td>每屏页数</td></tr>
								<tr><td colspan="3">&nbsp;</td></tr>
				<tr><td>返回值</td><td>fdom</td><td>返回pager链</td></tr>
			</table>
				<div class="example">
			<h3>示例 : </h3>
							<h5 xmlns="">CSS代码:</h5>
				<pre xmlns=""><code id="cssbox"></code></pre>
						
							<h5 xmlns="">HTML代码:</h5>
				<pre xmlns=""><code id="htmlbox"></code></pre>
									
				<h5 xmlns="">JS代码:</h5>
				<pre xmlns=""><code id="jsbox"></code></pre>
								</div>
		<div style="text-align:right">
			
					
				<button onclick="window.open('../codepages/74.html');">运行代码</button>
						
		</div><br/>	
		<div>
			<h3>同类参考 :</h3>
			<div>
							<span><a href='177.html'>F().anime</a></span>&#12288;|&#12288;							<span><a href='48.html'>F().drag</a></span>&#12288;|&#12288;							<span><a href='75.html'>F.dialog</a></span>&#12288;|&#12288;							<span><a href='51.html'>F().slides</a></span>&#12288;|&#12288;							<span><a href='80.html'>F().tree</a></span>&#12288;|&#12288;							<span><a href='50.html'>F.menu</a></span>&#12288;|&#12288;							<span><a href='32.html'>F.datePicker</a></span>&#12288;|&#12288;							<span><a href='28.html'>F.colorPicker</a></span>&#12288;|&#12288;							<span><a href='82.html'>F.canvas</a></span>						</div>
		</div>
	</div>
</div><br />

<textarea id="css" style="display:none;">html,body,table{font-size:15px;}
.st{background-color : orange;}
.ust{background-color:;}</textarea>
<textarea id="html" style="display:none;"><div id="statusBar"></div>
<div id="listbox" style="margin:20px 0px;"></div>
<div style="clear:both;" id="pagebox"></div></textarea>
<textarea id="js" style="display:none;">function up(){	
	F.get(url, {size:pager.size, page:pager.page}).call2json(function(o){
		pager.up(o.num);
		F("listbox").html(getHTML(o.data));
	});
}

function getHTML(a){
	var startIdx = (pager.page-1) * pager.size + 1;
	var html = "<tr>\
		<th>序号</th>\
		<th>商品名</th>\
		<th>价格</th>\
		<th>运费</th>\
		<th>地区</th>\
		<th>店铺</th>\
	</tr>";
	for(var i=0,l=a.length; i<l; i++){
		html += '<tr>\
			<td>'+(startIdx+i)+'</td>\
			<td>'+a[i].goods_name+'</td>\
			<td>'+a[i].goods_price+'</td>\
			<td>'+a[i].ship_fee+'</td>\
			<td>'+a[i].shop_region+'</td>\
			<td>'+a[i].shop_name+'</td>\
		</tr>';
	}
	html = '<table border="1"><caption><h3>安卓手机精选</h3></caption>'+html+'</table>';
	return html;
}

var url = F.data("data.php?act=gettaobao");	
var pager = F.pagination("pagebox",up).setsize(15);
up();</textarea>
<textarea id="result" style="display:none;"></textarea>


<script type="text/javascript">
var css = F('css').val();
var html = F('html').val();		
var js = F('js').val();
var result = F('result').val();
css && F('cssbox').highlight(css, "css");
html && F('htmlbox').highlight(html, "html");
js && F('jsbox').highlight(js, "js");
result && F('resultbox').highlight(result,"js");
</script>

</body>
</html>